// pages/user/register/index/explain/explain.js
import Dialog from "@vant/weapp/dialog/dialog";
Component({
    /*
    * 接收外部样式
    * */
    options: {
        addGlobalClass: true,
        multipleSlots: true
    },

    /**
     * 组件的属性列表
     */
    properties: {

    },

    /**
     * 组件的初始数据
     */
    data: {
        _checked: false
    },

    /**
     * 组件的方法列表
     */
    methods: {
        onChange: function (e) {
            let detail = e.detail;
            this.setData({_checked: detail})
        },
        bindToNext: function () {
            let checked = this.data._checked;
            if (checked) {
                this.triggerEvent("explain", {}, {}); //组件接收函数写入数据
            } else {
                Dialog.alert({
                    title: "提示",
                    message: "请确认已阅读此协议",
                    context: this
                })
            }
        }
    }
})
